package kr.co.creativeideas.gooq.activity;

import kr.co.creativeideas.gooq.view.IntroView;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.view.animation.Animation.AnimationListener;

public class IntroActivity extends Activity {

	private IntroView iv;
	private Animation anim;
	
	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.introactivity);

		iv = (IntroView) findViewById(R.id.introview);
		anim = AnimationUtils.loadAnimation(this, R.anim.intro);
		anim.setRepeatCount(1);
		anim.setAnimationListener(new AnimationListener() {

			@Override
			public void onAnimationStart(Animation animation) {
				// TODO Auto-generated method stub

			}

			@Override
			public void onAnimationRepeat(Animation animation) {
				// TODO Auto-generated method stub

			}

			@Override
			public void onAnimationEnd(Animation animation) {
				// TODO Auto-generated method stub
				Destroy();
			}
		});
		iv.startAnimation(anim);
	}
	
	
	private void Destroy() {
		Intent intent = new Intent(this, MainActivity.class);
		startActivity(intent);		
		finish();
	}
}